/*******************************************************************************
 * 顶部导航条动态菜单
 * 因实现麻烦，已废弃
 *******************************************************************************/
 
var menu = {
		'index'		: ['index/navigation.php', 'index/index.php'],
		'news'		: ['', 'news/news_list.php'],
		'report'	: ['', '/xiver/libs/piwik/index.php'],
		'system'	: ['', 'system/iProber.php']
};

// 调用另一个页面的函数
function bridge(action){
	try{
		if(!window.parent.frames["iBody"][action] || window.parent.frames["iBody"][action]== undefined){
			alert(action+':undefined');
		}else{
			switch(getMode()){
				case 'list':
					window.parent.frames["iBody"][action]();
					break;
				case 'edit':
					alert(_l.op_in_list_mode);
					break;
				default:
					alert(_l.unknown_error);
					break;
			}
		}
	}catch(e){}
}

// 打开地址
function open_url(func, target) {
	eori();
	if(!target || target == ''){
		target = 'iBody';
	}
	if(menu[func][0] != ''){window.parent.frames["lBody"].location = menu[func][0];}
	if(menu[func][1] != ''){window.parent.frames[target].location = menu[func][1];}
}

jQuery(function($){
	// 主菜单点击
	$('#main_menu a').click(function(event){
		event.stopPropagation();
		
		if($(this).attr('name') != undefined && $(this).attr('name') != ''){
			open_url($(this).attr('name'), $(this).attr('target'));
			//createSubMenu($(this).attr('name'));
		}
	});		
});